<?php

require_once dirname(__FILE__).'/../lib/tagGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/tagGeneratorHelper.class.php';

/**
 * tag actions.
 *
 * @package    check
 * @subpackage tag
 * @author     Éric Rogé <eric.roge@ui-studio.fr>
 * @version    SVN: $Id: actions.class.php 3 2009-06-19 20:51:19Z Eric.Roge $
 */
class tagActions extends autoTagActions
{
  public function executePromote(sfWebRequest $request)
  {
    $request->checkCSRFProtection();
    $todo = $this->getRoute()->getObject();
    $todo->promote();
    $this->getUser()->setFlash('notice', $todo.' has been moved up in list');

    $this->redirect('@tag');
  }

  public function executeDemote(sfWebRequest $request)
  {
    $request->checkCSRFProtection();
    $todo = $this->getRoute()->getObject();
    $todo->demote();
    $this->getUser()->setFlash('notice', $todo.' has been moved down in list');

    $this->redirect('@tag');
  }
}
